import socket
import threading
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(("192.168.1.9",60000))
server.listen(5)

clients = []

def handler_client(client_socket,address):
    while True:
        msg = client_socket.recv(1024*1024)
        for client in clients:
            client.send(f"{address} speak：{msg.decode('utf-8')}".encode('utf-8'))




while True:
    client_socket,address = server.accept()
    print(f"have one client{address} connected!")
    clients.append(client_socket)
    thread = threading.Thread(target=handler_client,args=(client_socket,address))
    thread.start()
